<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
        body{
            perspective:3000px;
        }
        .box {
            margin: 200px auto;
            width: 200px;
            height: 200px;
            position: relative;
            transform-style: preserve-3d;
            transition: all 2s;
        }
        .box:hover{
            transform: rotateX(340deg) rotateY(340deg) translate(0px,0px);
        }
        .item{
            width: 100%;
            height: 100%;
            position: absolute;
            font-size: 150px;
            line-height: 200px;
            text-align: center;
        }
        .item:nth-child(1){
            background: red;
            transform: rotateY(0deg) translateZ(100px);
        }
        .item:nth-child(2){
            background: orange;
            transform: rotateY(90deg) translateZ(100px);
        }
        .item:nth-child(3){
            background: yellow;
            transform: rotateY(180deg) translateZ(100px);
        }
        .item:nth-child(4){
            background: green;
            transform: rotateY(270deg) translateZ(100px);
        }
        .item:nth-child(5){
            background: blue;
            transform: rotateX(90deg) translateZ(100px);
        }
        .item:nth-child(6){
            background: deeppink;
            transform: rotateX(-90deg) translateZ(100px);
        }
    </style>
</head>
<body>
<div class="box">
    <div class="item">1</div>
    <div class="item">2</div>
    <div class="item">3</div>
    <div class="item">4</div>
    <div class="item">5</div>
    <div class="item">6</div>
</div>
</body>
</html>